<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>

<head>
  <title>星范后台管理系统</title>
  <link rel="stylesheet" type="text/css" href="/resource/css/main.css" />
  <style type="text/css">
    body{
      margin: 0;
      padding: 0;
    }
  </style>
  <script type="text/javascript" src="/resource/script/jquery.js"></script>
  <script type="text/javascript" src="/resource/script/jquery.watermark.js"></script>
  <script type="text/javascript">
    $(document).ready(function(){
      $("#txtName").watermark({
        watermarkText: "邮箱",
        className: "watermark"
      });

      $("#btnSubmit").click(function () {
        var name = $("#txtName").val();
        var pwd = $("#txtPwd").val();
        $.post("/login/submit",
          {
            adminName:name,
            adminPwd:pwd
          },
          function(data, status){
            if(status == "success"){
              if (data.result){
                location.href = "/main";
              }
              else {
                alert(data.errorMsg);
              }
            }
            else {
              alert("网络请求出错，请重新再试！");
            }

          }
        );
      });
    });
  </script>
</head>

<body>
<div id="divHeader" style="width: 100%; height: 92px; top: 0; left: 0; margin: 0; background-image: url('/resource/img/title_bg.png'); padding: 0"></div>

<img src="/resource/img/login_logo.png" style="position: absolute; top: 140px; left: 50%; margin-left: -77px;" />

<input type="text" id="txtName" style="background-image: url('/resource/img/login_input.png'); position: absolute; top: 274px; left: 50%; margin-left: -136px; width: 272px; height: 46px; border: none; font-size: 14px; padding: 0 5px;" />
<input type="password" id="txtPwd" style="background-image: url('/resource/img/login_input.png'); position: absolute; top: 344px; left: 50%; margin-left: -136px; width: 272px; height: 46px;border: none; font-size: 14px;  padding: 0 5px;" />
<input type="button" value="登录" id="btnSubmit" style="background-image: url('/resource/img/login_btn_normal.png'); position: absolute; top: 441px; left: 50%; margin-left: -136px; width: 272px; height: 46px; border: none; font-size: 18px; color: #FFFFFF;" />

</body>
</html>
